<div ng-controller="exchangeRecordCtrl">
    <br>
    <br>
    <label class="control-label" for="textinput">状态:</label>
    <select ng-model="status" ng-options="c.status as c.name for c in statusSelect"
            ng-change="getExchangeRecord(status)">
        <option value="">--请选择--</option>
    </select>
    <br><br>
    <span class = "goods-search">商品名称：<input type="text" id = "goods_search"> <a class="btn-primary btn-sm" ng-click="searchGoods()">搜索</a></span>
    <br>

    <paging>
        <ul class="pagination" num-pages="tasks.pageCount" current-page="tasks.currentPage"
            on-select-page="selectPage(page)">
            <li ng-class="{disabled: noPrevious()}"><a ng-click="selectPrevious()">&laquo;</a>

            </li>
            <li ng-repeat="page in pages" ng-class="{active: isActive(page)}"><a
                    ng-click="selectPage(page)">{{page}}</a>

            </li>
            <li ng-class="{disabled: noNext()}"><a ng-click="selectNext()">&raquo;</a>

            </li>
            <li ng-show="currentPage>6"><a ng-click="selectPage(1)">首页</a>

            </li>
        </ul>
    </paging>

    <div class="tab-content">
        <div class="tab-pane active" id="tab_a">
            <table class="table table-condensed">
                <thead>
                <tr>
                    <th>商品名称</th>
                    <th>兑换数量</th>
                    <th>兑换价格</th>
                    <th>联系姓名</th>
                    <th>联系电话</th>
                    <th>联系地址</th>
                    <th>所属小区</th>
                    <th>订单状态</th>
                    <th>修改时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="temp in exchangeList">
                    <td>{{temp.productName}}</td>
                    <td>{{temp.exchangeNum}}</td>
                    <td>{{temp.productPrice}}</td>
                    <td>{{temp.userName}}</td>
                    <td>{{temp.mobile}}</td>
                    <td>{{temp.address}}</td>
                    <td>{{temp.communityName}}</td>
                    <td>
                        <span ng-repeat="m in statusSelect">
                            <span ng-show="m.status == temp.status">{{m.name}}</span>
                        </span>
                    </td>
                    <td>{{temp.createTime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>
                        <a ng-show="temp.status == 0" class="btn btn-default btn-xs"
                           ng-click="examineProduct(temp.id,2)">开始处理</a>
                        <a ng-show="temp.status == 0 || temp.status == 2" class="btn btn-secondary btn-xs"
                           ng-click="examineProduct(temp.id,1)">通过</a>
                        <a ng-show="temp.status == 0 || temp.status == 2" class="btn btn-danger btn-xs"
                           ng-click="examineProduct(temp.id,-1)">拒绝</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>